package com.neusoft.simple;

import com.neusoft.AnmuxiMile;
import com.neusoft.MengniuMile;
import com.neusoft.Mile;
import com.neusoft.YiliMile;

/**
 * @description:
 * @createDate： 2018/12/10.
 * @author： xiongshx.
 */
public class SimpleFactory {

    public Mile getMile(String name){
        if ("anmuxi".equals(name)) {
            return new AnmuxiMile();
        }else if ("mengniu".equals(name)) {
            return new MengniuMile();
        }else if ("yili".equals(name)) {
            return new YiliMile();
        }else {
            System.out.println("找不到对应的商品");
            return null;
        }
    }

}
